#!/bin/bash

cd ~
# mkdir downloads
# cd ~/downloads

# curl -LO https://ghp.ci/https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz

read -p "confirm neovim tar file exists"

if [ ! -e ~/nvim-linux-x86_64.tar.gz ]; then
    echo "neovim doesn't exist, exit."
    exit
fi

tar -zxvf nvim-linux-x86_64.tar.gz
sudo mv ./nvim-linux-x86_64 /opt/nvim
sudo ln -s /opt/nvim/bin/nvim /usr/local/bin/nvim
sudo ln -s /opt/nvim/bin/nvim /usr/local/bin/nv

rm nvim-*

# nvim
